package com.serviceImpl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.bean.StockApply;
import com.mapper.ReturnApplyMaterialMapper;
import com.mapper.StockApplyMapper;
import com.service.StockApplyService;

/**
 * @author author : 张鹏
 * @date createTime：2018年3月1日 下午11:27:03
 * @Description: 该类的功能描述
 */
@Service
public class StockApplyServiceImpl implements StockApplyService {
	@Resource
	private StockApplyMapper stockApplyMapper;

	@Override
	public List<StockApply> getStockApplyByCategory(String category) {
		// TODO Auto-generated method stub
		return stockApplyMapper.selectByCategory(category);
	}

	@Override
	public StockApply getStockApplyByPrimaryKey(int stockApplyId) {
		// TODO Auto-generated method stub
		return stockApplyMapper.selectByPrimaryKey(stockApplyId);
	}

	@Override
	public int exameStockApply(StockApply stockApply) {
		// TODO Auto-generated method stub
		return stockApplyMapper.exameByPrimaryKey(stockApply);
	}

	@Override
	public int deleteStockApply(int stockApplyId) {
		// TODO Auto-generated method stub
		return stockApplyMapper.deleteByPrimaryKey(stockApplyId);
	}

	@Override
	public int createNewStockApply(StockApply stockApply) {
		// TODO Auto-generated method stub
		return stockApplyMapper.insert(stockApply);
	}

	@Override
	public List<StockApply> getStockApplyByState(int state) {
		// TODO Auto-generated method stub
		return stockApplyMapper.selectByState(state);
	}

	@Override
	public List<StockApply> getStockApplyByFinish(int finish) {
		// TODO Auto-generated method stub
		return stockApplyMapper.selectByFinish(finish);
	}

	@Override
	public List<StockApply> getStockApplyByStateAndCategory(StockApply stockApply) {
		// TODO Auto-generated method stub
		return stockApplyMapper.selectByStateAndCategory(stockApply);
	}

	@Override
	public int deleteStockApplyByFinish(StockApply stockApply) {
		// TODO Auto-generated method stub
		return stockApplyMapper.updateSetFinishMinusOne(stockApply);
	}

	@Override
	public List<StockApply> getStockApplyByFinishAndCategory(
			StockApply stockApply) {
		// TODO Auto-generated method stub
		return stockApplyMapper.selectByFinishAndCategory(stockApply);
	}

}
